FROM golang:1.17 AS build
WORKDIR $GOPATH/src/task_module3
COPY . .
ENV CGO_ENABLED=0
ENV GO111MODULE=on
ENV GOPROXY=https://goproxy.cn,direct
RUN GOOS=linux go build -installsuffix cgo -o task_module3 main.go \
FROM busybox \
RUN mkdir "$GOPATH/src/task_module3"
COPY --from=build $GOPATH/src/task_module3 $GOPATH/src/task_module3
EXPOSE 8080
ENV ENV local
WORKDIR $GOPATH/src/task_module3
ENTRYPOINT ["./task_module3"]